package com.eightywork.life.adapter;

import java.util.List;


import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

import com.eightywork.life.R;
import com.eightywork.life.model.Xiaoqu;

public class LoginNeighborAdapter extends ArrayAdapter<Xiaoqu> {
	private LayoutInflater mInflater;
	private int mResource = R.layout.item_neighbor2;

	public LoginNeighborAdapter(Context context, List<Xiaoqu> list) {
		super(context, 0, list);
		mInflater = (LayoutInflater) context
				.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
	}

	@Override
	public View getView(int position, View convertView, final ViewGroup parent) {
		View layout = convertView;
		if (layout == null) {
			layout = mInflater.inflate(mResource, parent, false);
		}
		Xiaoqu item = getItem(position);
		TextView name = (TextView) layout.findViewById(R.id.name);
		TextView location = (TextView) layout.findViewById(R.id.location);
		name.setText(item.getXiaoquname());
		location.setText(item.getAddress());
		return layout;
	}
}
